﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using IronCommander.ViewModels;

namespace IronCommander.Domain
{
    public class FileSystemInfoProvider : IFileSystemInfoProvider
    {
        public IEnumerable<DriveViewModel> GetDrives()
        {
            return DriveInfo.GetDrives().Select(d => DriveViewModel.Create(d));
        }

        public IEnumerable<FileViewModel> GetFiles(string path)
        {
            return new DirectoryInfo(path).EnumerateFileSystemInfos().Select(f => new FileViewModel(f));
        }
    }
}
